#ifndef CLIENTSOCKET_H
#define CLIENTSOCKET_H

//#include <QObject>
#include "precomp.h"

//#include <QTcpSocket>
//#include <QVariantMap>

class ClientSocket : public QObject
{
    Q_OBJECT
public:
    explicit ClientSocket(QObject *parent = nullptr);
    ~ClientSocket();
    QString m_sendMsg;
    QString m_flag;
    QByteArray m_recvBuffer;
signals:
    void dataReceived( QByteArray data,QString flag);

public slots:
    void startConnection( QString serverAddress, quint16 serverPort);

private slots:
    void socketConnected();
    void socketError(QAbstractSocket::SocketError error);
    void readData();

private:
    QTcpSocket *_socket;

};

#endif // CLIENTSOCKET_H
